package cursojava.bean;

import java.io.Serializable;

public class Transformer implements Serializable, Comparable<Transformer>{

	private static final long serialVersionUID = 7750640943225840977L;
	
	private String name;
	private String life;
	private String[] weapons;
	private String cad = "prueba";
	
	public Transformer(String name, String life, String[] weapons) {
		
		this.name = name;
		this.life = life;
		this.weapons = weapons;
	}
	
	public Transformer(String name, String life) {
		
		this.name = name;
		this.life = life;

	}
	
	public Transformer() {
		
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = "AUT-" + name;
	}

	public String getLife() {
		return life;
	}

	public void setLife(String life) {
		this.life = life;
	}

	public String[] getWeapons() {
		return weapons;
	}

	public void setWeapons(String[] weapons) {
		this.weapons = weapons;
	}
	
	
	@Override
	public boolean equals(Object obj) {
		// TODO Auto-generated method stub
		return this.name.equals(((Transformer)obj).getName());
	}
	
	@Override
	public int hashCode() {
		// TODO Auto-generated method stubs
		System.out.println(cad.hashCode());
		return cad.hashCode(); //name.hashCode();
	}

	@Override
	public int compareTo(Transformer o) {
		// TODO Auto-generated method stub
		System.out.println("---"+cad.hashCode());
		return this.name.compareTo(o.name);
	}
	
	
	
	
}
